<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
<title>${name_china}管理-新建${name_china}</title>
 <%@include file="/common/head.jsp" %>

</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>新建${name_china}</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="addForm" method="post">
  <div id="left" style="width:80%;float:left">
	 <div class="form-wrapper">
		<div class="h4 distance-double">
	        <span class="h4-title"><i class="icon icon-setting"></i>基本信息</span>
	        <span class="h4-border"></span>
	    </div>
	    
	     <div class="form-cont">
	        <p class="form-cont-title">排序号</p>
	        <input type="text" id="reorder" name="reorder" class="summer-input summer-validatebox"  data-validatebox="validType:['noNegativeNumber']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>用户ID</p>
	        <input type="text" id="userId" name="userId" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[50]']"/> 
	     </div> 
	     
	     <div class="form-cont">
	        <p class="form-cont-title">用户名</p>
	        <input type="text" id="userNickName" name="userNickName" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[11]']"/> 
	     </div>
	     
	      <div class="form-cont">
	        <p class="form-cont-title">收货人姓名</p>
	        <input type="text" id="reciever" name="reciever" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[11]']"/> 
	     </div>
	     
	      <div class="form-cont">
	        <p class="form-cont-title">收货人电话</p>
	        <input type="text" id="phone" name="phone" class="summer-input"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">收货人地址</p>
	        <input type="text" id="address" name="address" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品IDS</p>
	        <input type="text" id="goodsId" name="goodsId" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品名称</p>
	        <input type="text" id="goodsName" name="goodsName" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品图片</p>
	        <input type="text" id="goodsImg" name="goodsImg" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品原价</p>
	        <input type="text" id="goodsOriginprice" name="goodsOriginprice" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品折后价</p>
	        <input type="text" id="goodsDiscountPrice" name="goodsDiscountPrice" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品颜色</p>
	        <input type="text" id="goodsColor" name="goodsColor" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品尺寸</p>
	        <input type="text" id="goodsSize" name="goodsSize" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">数量</p>
	        <input type="text" id="count" name="count" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否折扣价</p>
	        <input type="text" id="isDiscount" name="isDiscount" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否使用红包</p>
	        <input type="text" id="isRedpac" name="isRedpac" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">物流费用</p>
	        <input type="text" id="transfee" name="transfee" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">实际支付金额</p>
	        <input type="text" id="actualPay" name="actualPay" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否退换</p>
	        <input type="text" id="isReturn" name="isReturn" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单号</p>
	        <input type="text" id="orderNo" name="orderNo" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">支付交易号</p>
	        <input type="text" id="payNo" name="payNo" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	   
	     <div class="form-cont">
	        <p class="form-cont-title">付款时间</p>
	        <input type="text" id="payTime" name="payTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">红包金额</p>
	        <input type="text" id="redpacAmount" name="redpacAmount" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺ID</p>
	        <input type="text" id="storeId" name="storeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺名称</p>
	        <input type="text" id="storeName" name="storeName" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>

	     <div class="form-cont">
	        <p class="form-cont-title">订单开始时间</p>
	        <input type="text" id="startTime" name="startTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单结束时间</p>
	        <input type="text" id="endTime" name="endTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">发货时间</p>
	        <input type="text" id="transTime" name="transTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	    
	     
	     <div class="form-cont">
	        <p class="form-cont-title">折扣券ID</p>
	        <input type="text" id="couponId" name="couponId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺ID</p>
	        <input type="text" id="storeId" name="storeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">物流ID</p>
	        <input type="text" id="transId" name="transId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单状态</p>
	        <input type="text" id="state" name="state" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">售后申请ID</p>
	        <input type="text" id="afterSaleAppid" name="afterSaleAppid" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">评论ID</p>
	        <input type="text" id="judgeId" name="judgeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示退货按钮</p>
	        <input type="text" id="isShowCancel" name="isShowCancel" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示换货按钮</p>
	        <input type="text" id="isShowChange" name="isShowChange" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示维修按钮</p>
	        <input type="text" id="isShowFix" name="isShowFix" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单类型（友惠家）</p>
	        <input type="text" id="type" name="type" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">售后处理状态</p>
	        <input type="text" id="aftersaleState" name="aftersaleState" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	    
	 <div class="form-btn-wrapper" id="funcbar">
        <a class="btn btn-normal" id="backBtn">关闭</a>
    </div>
  </div>
  </div>
	
</form>
<script>
    var  permission = CommonUtil.getPermission('${name_english}');
    $(function () {
 
    	//初始化funcbar
     	$('#funcbar').prepend($.funcbar({
            type: 'button',
            data: permission,
            permit: ['${name_english}:add']
        }));
   	    
    	//初始化下拉选项
      	 $('#isDiscount').combobox({
              valueField : 'code',
              textField : 'name',
              url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_DISCOUNT'
          });
    	
     	//初始化下拉选项
       	 $('#isRedpac').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_REDPAC'
           });
     	
     	//初始化下拉选项
       	 $('#isReturn').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_RETURN'
           });
     	
     	//初始化下拉选项
       	 $('#state').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_STATE'
           });
     	
     	//初始化下拉选项
       	 $('#isShowCancel').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_CANCEL'
           });
     	
     	//初始化下拉选项
       	 $('#isShowChange').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_CHANGE'
           });
     	
     	//初始化下拉选项
       	 $('#isShowFix').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_FIX'
           });
     	 
       	 $('#aftersaleState').combobox({
             valueField : 'code',
             textField : 'name',
             url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_AFTERSALE_STATE'
         });
    	//保存按钮
    	$('#funcbar').on('click', 'a[data-permit="${name_english}:add"]', {isContinue: false},  submit);
    	
    	//返回按钮
    	$('#backBtn,#goBack').on('click',backMain);
    	
    });
    
    
    //表单提交
    function submit(event) {
         $("#addForm").form({
        	 buttons : ['#saveBtn','#saveBtnContinue'],
             ajax: {
                 url: CONST_URL.ADD
             },
             onSubmitSuccess: function (data) {
            	 $.stip({
  	                type:'ok',//显示类型 有info、 ok、 danger
  	                text: '保存成功！',
  	                onBeforeHide: function () {
  	            	  var isContinue = event.data.isContinue;
                   	  if (isContinue) {
                          resetForm();
                   	  } else {
                   		  backMain();
                   	  }
  	               }
              	});
              }
         }).form("submit");
    }
    
    //保存并继续清空form
    function resetForm(){
        //$('#xm,#zw,#cs,#bgdh,#sjhm').val('');
    }
    
    //返回主页面
    function backMain() {
    	window.location.href = CONST_URL.INIT_MAIN;
    }
    
   
    //请求url
    var CONST_URL = {
    	INIT_MAIN: basePath + "${common_url}init",
       	ADD: basePath + "${common_url}add"
    };
    
</script>
</body>
</html>